package kr.hkit.androidcomplete03.ch22;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class Translate2 extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new MyView(this));
	}
	
	protected class MyView extends View {
		// 생성자 생성
		public MyView(Context context) {
			super(context);
		}

		// 그리기 함수
		public void onDraw(Canvas canvas) {
			Paint Pnt = new Paint();
			Pnt.setAntiAlias(true);
			Pnt.setTextSize(50);

			Pnt.setColor(Color.BLACK);
			String[] arStr = {"One", "Two", "Three", "Four", "Five", "Six"};
			
			for(String s : arStr){
				canvas.drawText(s, 10, 30, Pnt);
				canvas.translate(0, 40);
			}
			
		}
	}
}
